//
//  PublicHeadView.m
//  AmountBody
//
//  Created by smm on 2017/12/18.
//  Copyright © 2017年 RCMTM. All rights reserved.
//

#import "PublicHeadView.h"

@implementation PublicHeadView


- (instancetype)initWithCoder:(NSCoder *)aDecoder {
    self = [super initWithCoder:aDecoder];
    if (self) {

    }
    return self;
}

- (instancetype)initWithFrame:(CGRect)frame {
    
    self = [super initWithFrame:frame];
    if (self) {
        
    }
    return self;
}

-(void)setLeftButton:(UIButton *)leftButton
{
    _leftButton.tag = 100;
    _leftButton = [self viewWithTag:100];
    [_leftButton removeFromSuperview];
    _leftButton = leftButton;
     [self addSubview:_leftButton];
}
-(void)setRightButton:(UIButton *)rightButton
{
    _rightButton.tag = 200;
    _rightButton = [self viewWithTag:200];
    [_rightButton removeFromSuperview];
    _rightButton = rightButton;
    [self addSubview:_rightButton];
    [_rightButton mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(@(-25));
        make.width.equalTo(@(rightButton.frame.size.width));
        make.top.equalTo(@30);
        make.height.equalTo(@(rightButton.frame.size.height));
    }];
}
-(void)setTitleLabel:(UILabel *)titleLabel
{
    _titleLabel.tag = 300;
    _titleLabel = [self viewWithTag:300];
    [_titleLabel removeFromSuperview];
    _titleLabel = titleLabel;
    [self addSubview:_titleLabel];
    [_titleLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self).offset(20);
        make.centerX.equalTo(self);
        make.height.equalTo(@44);
    }];
//    label.frame = CGRectMake((SCREEN_W-label.frame.size.width)/2.0, 20, label.frame.size.width, 44);
    
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
